//引入公共文件
import '@utils/init.js'


import ajax from '@utils/ajax.js'
getUserInfo();
// 获取当前登录的用户信息
async function getUserInfo() {
    const res = await ajax({
        url: '/users/getUserInfo',
        type: 'POST',
        // 将 token 添加到请求头中
        headers: {
            Authorization: localStorage.token
        },
    })
    if (res.code) {
        $('#username').text(res.result.username)
    }
}